"""
@Author：WangYuXiang
@E-mile：Hill@3io.cc
@CreateTime：2021/3/24 16:36
@DependencyLibrary：无
@MainFunction：无
@FileDoc： 
    urls.py
    文件说明
@ChangeHistory:
    datetime action why
    example:
    2021/3/24 16:36 change 'Fix bug'
        
"""
from common.auth.views.group import GroupViewSet, GroupRoleTreeView, GroupEmployUserListView
from common.auth.views.login import LoginByAP, LoginByTR
from common.auth.views.permission import PermissionViewSet, PermissionHandleView
from common.auth.views.role import RoleViewSet, RoleEmployUserListView, RoleDismissView, RoleEmployView
from common.auth.views.user import UserViewSet, UserSearchView
from sanic_rest_framework.routes import ViewSetRouter

router = ViewSetRouter()
router.register(PermissionViewSet, '/permission', 'permission')
router.register(GroupViewSet, '/group', 'group')
router.register(RoleViewSet, '/role', 'role')
router.register(UserViewSet, '/user', 'user')
urls = [
           {'handler': LoginByAP.as_view(), 'uri': '/login', 'name': 'login'},
           {'handler': LoginByTR.as_view(), 'uri': '/sign_role', 'name': 'sign_role'},
           {'handler': GroupRoleTreeView.as_view(), 'uri': '/group_role_tree', 'name': 'group_role_tree'},
           {'handler': PermissionHandleView.as_view(), 'uri': '/permission_handle', 'name': 'permission_handle'},
           {'handler': GroupEmployUserListView.as_view(), 'uri': '/group_employ_user_list/<pk:string>', 'name': 'group_employ_user_list'},
           {'handler': RoleEmployUserListView.as_view(), 'uri': '/role_employ_user_list/<pk:string>', 'name': 'role_employ_user_list'},
           {'handler': RoleEmployView.as_view(), 'uri': '/role_employ', 'name': 'role_employ'},
           {'handler': RoleDismissView.as_view(), 'uri': '/role_dismiss', 'name': 'role_dismiss'},
           # {'handler': UserSearchView.as_view({'get': 'list'}), 'uri': '/search_employ_user', 'name': 'search_employ_user'},
           {'handler': UserSearchView.as_view({'get': 'list'}), 'uri': '/search_user', 'name': 'search_user'},
           # {'handler': AdminLogin.as_view(), 'uri': '/login', 'name': 'login'}
       ] + router.urls
